// 修改密码
const ochangpassword = document.querySelector(".repassworld2");
const oset = document.querySelector("#repassworld");
ochangpassword.addEventListener("click", function() {
    if (oset.value == "") {
        alert("请输入要修改的密码")
    } else {
        // console.log(localStorage.username);
        ajax({
            url: "http://localhost:3000/api",
            data: {
                type: "getPassword",
                username: localStorage.username,
                password: oset.value
            },
            success: res => {
                console.log(res);
            }
        })

        alert("密码修改成功,请重新登录");
        oset.value = "";
        location.href = "./login.html";


        // 退出登录
        // const ologin = document.querySelector(".login");
        // const owelcome = document.querySelector(".welcome");
        // const oun = document.querySelector(".un");
        // localStorage.removeItem("username");
        // localStorage.setItem("isLogin", "");
        // ologin.style.display = "block";
        // owelcome.style.display = "none";
        // oun.innerHTML = "xxx";

        // location.href = "./register.html"

    }

})